import { Request, Response } from 'express';

const dataSource: any[] = [];

for (let i = 0; i < 10; i += 1) {
  dataSource.push({
    key: i,
    id: 123456 + i,
    deliveryWay: 1,
    createTime: '2020-1-1 12:12:12',
    expCode: 'SF1029203939',
    consigneePhone: '18555553928',
    expressName: '圆通快递',
    courierPhone: '18430293847',
    courierName: '小强',
    inTime: '2019-12-12 10:00:00',
    status: 10101,
    statusName: '正常',
  });
}

function getHistoryList(req: Request, res: Response, u: string) {
  const result = {
    code: 0,
    message: 'success',
    body: {
      count: 56,
      list: dataSource,
    },
  };

  return res.json(result);
}

export default {
  'GET /history/list': getHistoryList,
};
